kill-whole-line: Honor visibility; fix kill-ring when read-only (bug#65734)
authorSebastian Miele <iota@whxvd.name>
Wed, 19 Jun 2024 13:48:59 +0000 (15:48 +0200)
committerEli Zaretskii <eliz@gnu.org>
Thu, 27 Jun 2024 07:48:18 +0000 (10:48 +0300)
commit058bb4ca25adb8f4bf78cc0f09a65d730dbd797d
tree8c361b2ac539898c038903439a6ee18da67086a6
parente45173d114e37d5a652b5393ce7bcab1acea3f1a
kill-whole-line: Honor visibility; fix kill-ring when read-only (bug#65734)

* lisp/simple.el (kill-whole-line): Use visibility state before
performing any edits as reference instead of expecting that visibility
cannot change.  First of the two calls to `kill-region' may trigger
`after-change-functions' that might alter the visibility state.
Make sure that we populate the `kill-ring' with the contents of the
whole line when buffer is in `read-only-mode'.
lisp/simple.el